add_executable(tessellation-modes WIN32 MACOSX_BUNDLE
    main.cpp
    tessellatedquadmesh.cpp tessellatedquadmesh.h
)
qt_add_qml_module(tessellation-modes
    URI tessellation_modes
    VERSION ${PROJECT_VERSION}
    QML_FILES
        main.qml
        BasicCamera.qml
        TessellatedWireframeEffect.qml
        TessellatedWireframeMaterial.qml
        TessellatedQuad.qml
    RESOURCES
        shaders/flat.frag
        shaders/isolines.tcs
        shaders/isolines.tes
        shaders/passthru.vert
        shaders/phongwireframe.frag
        shaders/quads.tcs
        shaders/quads.tes
        shaders/triangles.tcs
        shaders/triangles.tes
        shaders/robustwireframe.geom
    NO_RESOURCE_TARGET_PATH
)

target_link_libraries(tessellation-modes PRIVATE
    Qt${QT_VERSION_MAJOR}::3DCore
    Qt${QT_VERSION_MAJOR}::3DInput
    Qt${QT_VERSION_MAJOR}::3DQuick
    Qt${QT_VERSION_MAJOR}::3DQuickExtras
    Qt${QT_VERSION_MAJOR}::3DRender
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Qml
    Qt${QT_VERSION_MAJOR}::Quick
)

install(TARGETS tessellation-modes
    BUNDLE DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

# Consider using qt_generate_deploy_app_script() for app deployment if
# the project can use Qt 6.3. In that case rerun qmake2cmake with
# --min-qt-version=6.3.
